<template>
	<view>
		<uni-steps :options="list1" :active="3"></uni-steps>
		<uni-card title="乘客信息">
			<view>乘客姓名：{{xinxi.name}}</view>
			<view>手机号码：{{xinxi.phone}}</view>
			<view>上车地点：{{xinxi.shanc}}</view>
			<view>下车地点：{{xinxi.xiac}}</view>
			<view>乘车日期：{{time}}</view>
		</uni-card>
		<uni-group style="position: fixed;bottom: 0%;right: 0%;left: 0%;z-index: 99;">
			<button type="primary" @click="xia">提交订单</button>
		</uni-group>
	</view>
</template>

<script>
	import api from 'commer/apiURL.js'
	export default {
		data() {
			return {
				base:api.baseurl,
				list1: [{
						title: '第一步'
					},
					{
						title: '第二步'
					},
					{
						title: '第三步'
					},
					{
						title: '第四步'
					}
				],
				chen: [],
				time: [],
				xinxi: []
			}
		},
		onLoad() {
			this.time = uni.getStorageSync('time')
			this.xinxi = uni.getStorageSync('xinxi')[0]
			this.chen = uni.getStorageSync('ban')
			console.log(this.chen)
		},
		methods: {
			xia() {
				this.$post(this.base + '/prod-api/api/bus/order', {
					"start": this.xinxi.shanc,
					"end": this.xinxi.xiac,
					"price": this.chen.price,
					"path": this.chen.name,
					"status": this.chen.id
				}).then((res) => {
					if (res.code == 200) {
						uni.showToast({
							title: '提交成功'
						})
						setTimeout(()=>{
							uni.navigateTo({
								url:'custom_shuttle'
							})
						},500)
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}

				})
			}
		}
	}
</script>

<style>

</style>
